﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace ActionSystem.Core.Utils
{
    //通用单利
    public class NormalSingleton<T> where T : NormalSingleton<T>,new()
    {
        private static T _instance = null;
        public static T Instance
        {
            get
            {
                if(_instance==null)
                {
                    _instance = new T();
                    _instance.Init();
                }
                return _instance;
            }
        }
        //初始化
        public virtual void Init() { }
    }
}


